import request from '@/utils/request.js'

// 常量
const api_name = '/system/admin/role'

export default {
    getRolePage(params) {
        return request({
            url: `${api_name}/getRolePage`,
            method: 'get',
            params: params
        })
    },
    getRoleDetailsById(id) {
        return request({
            url: `${api_name}/getRoleDetailsById/${id}`,
            method: 'get'
        })
    },
    saveRole(data) {
        return request({
            url: `${api_name}/saveRole`,
            method: 'post',
            data: data
        })
    },
    updateRole(data) {
        return request({
            url: `${api_name}/updateRole`,
            method: 'post',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/batchDeleteByIds`,
            method: 'post',
            data: ids
        })
    },
    assignMenusToRole(roleId,menuIds) {
        return request({
            url: `${api_name}/assignMenusToRole/${roleId}`,
            method: 'post',
            data: menuIds
        })
    },
}
